Stretch layout, JSON scroll views, TextView completion and Select fixes - #65
Merged
Merged
Conversation
ScrollView binds "contentView" from JSON and installs it with setContentView, as Panel does for its accessory view. ScrollView also overrides View::init, so a ScrollView that JSON creates gets its scroll bar. Before this, only the initWithFrame path created one, and a JSON ScrollView asserted on its first content view. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A StackView gives each subview the size of its content along its axis, and the fill distributions scale every subview alike. A subview styled with stretch now shares whatever space the StackView's bounds leave, so that one child, such as a page beneath a row of tabs, can fill a StackView that its superview sizes. Existing layouts do not change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
View::setVisibility asks the superview for layout, but a visibility that a Stylesheet sets is bound directly by View::applyStyle, which did not. A view that a class change made visible drew at its stale frame, over its siblings, until something else laid out its StackView. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The view's contain mask was set in its element style, which outranks every Stylesheet, so no layout could make it fill its superview. It now wears the tabViewController class, which the default stylesheet sizes to contain. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TextViewDelegate::completionsForPrefix returns the completions for the text before the cursor. Tab completes to the longest prefix they share, and then Tab and Shift+Tab cycle through them. A lone completion is not cycled, so the next Tab asks again, e.g. for a completed directory's contents. Editing, moving the cursor or losing focus ends cycling. When there is nothing to complete, Tab ends editing and advances the key responder as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The options were removed while the array was enumerated, which skipped every other option, so a Select that was cleared and filled again kept stale options. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Three moderate layout/input issues and one documentation issue remain unresolved.
Review effort: Lite
Findings: None
What changed in this PR
Updates the Quetoo material editor’s layout, scrolling, text completion, selection controls, styling, and test integration.
Changes:
- Adds StackView stretching and visibility relayout.
- Adds JSON ScrollView content views and TextView completion cycling.
- Fixes Select option removal and TabViewController styling.
- Updates tests, build targets, schemes, and generated stylesheet assets.
| File | Summary |
|---|---|
Tests/ObjectivelyMVC/View.c |
Adds layout, visibility, and JSON tests. |
Tests/ObjectivelyMVC/TextView.c |
Adds completion tests. |
Tests/ObjectivelyMVC/Makefile.am |
Registers TextView tests. |
Tests/ObjectivelyMVC/.gitignore |
Ignores the TextView test binary. |
Sources/ObjectivelyMVC/WindowController.c |
Integrates TextView Tab handling. Moderate issue: keypad Tab traversal is not handled. |
Sources/ObjectivelyMVC/View.h |
Declares stretch. |
Sources/ObjectivelyMVC/View.c |
Binds stretch and visibility relayout. Moderate issue: changing stretch does not invalidate the superview layout. |
Sources/ObjectivelyMVC/TextView.h |
Adds completion API and state. Nit: PR issue reference appears unrelated. |
Sources/ObjectivelyMVC/TextView.c |
Implements completion and cycling. |
Sources/ObjectivelyMVC/TabViewController.c |
Adds the controller styling class. |
Sources/ObjectivelyMVC/StackView.c |
Distributes remaining space to stretched children. Moderate issue: finite max-size clamping can leave incorrect spacing. |
Sources/ObjectivelyMVC/Select.c |
Removes all options correctly. |
Sources/ObjectivelyMVC/ScrollView.h |
Documents JSON content views. |
Sources/ObjectivelyMVC/ScrollView.c |
Supports JSON content views and initialization. |
Sources/ObjectivelyMVC/Image.c |
Adds compile compatibility include. |
ObjectivelyMVC.xcodeproj/xcshareddata/xcschemes/ObjectivelyMVC-TextView.xcscheme |
Adds the TextView test scheme. |
ObjectivelyMVC.xcodeproj/xcshareddata/xcschemes/ObjectivelyMVC-Text.xcscheme |
Adds the Text test scheme. |
ObjectivelyMVC.xcodeproj/xcshareddata/xcschemes/ObjectivelyMVC-Image.xcscheme |
Adds the Image test scheme. |
ObjectivelyMVC.xcodeproj/project.pbxproj |
Registers test targets and sources. |
Assets/stylesheet.css.h |
Regenerates embedded stylesheet data. |
Assets/stylesheet.css |
Adds TabViewController styling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A stretched subview that its max size clamped still advanced the stack by its full share, which left a gap. It now advances by its real size, and the unused share goes to the next stretched subview. A style change to stretch now lays out the superview again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TextView already completes with keypad Tab, but WindowController moved focus only for Tab. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Addressed the Copilot overview findings:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Layout and control changes for the Quetoo in-game material editor (jdolan/quetoo#1084).
Changes
contentView. A JSONScrollViewnow gets its scroll bar through aView::initoverride.stretch: a new@styledattribute. AStackViewgives its remaining main-axis space to the subviews that stretch.tabViewController, so that a stylesheet can style it. Before, an element style setcontain, and a stylesheet could not override it.TextViewDelegate::completionsForPrefixcompletes to the longest common prefix, and then Tab and Shift+Tab cycle through the matches. It includes tests.Select::removeAllOptions: the function now removes all options. Before, it removed only every second option, so a Select that was cleared and filled again kept stale options.Tests
make check: all 9 suites pass.🤖 Generated with Claude Code